<%@page import="com.shsh.safemanage.model.Department2"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.model.Department1"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.DepartmentDao"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<%
{
Long theDepart1ID = 0L;
Long theDepart2ID = 0L;

String depart1IDStr = request.getParameter(Constants.REQUEST_PARAMETER_DEPARTMENT1ID);
try {
	theDepart1ID = new Long(depart1IDStr);
} catch (Exception e) {
}

String depart2IDStr = (String)request.getParameter(Constants.REQUEST_PARAMETER_DEPARTMENT2ID);
try{
	theDepart2ID = Long.parseLong(depart2IDStr);
}catch(Exception e){
	
}

DepartmentDao departDao = DaoCreator.createDepartmentDao();
List<Department2> depart2List = departDao.getDepartment2ListByDepartment1ID(theDepart1ID);
%>
<select id="depart2" onchange="selectDepart2();">
<%
for (Department2 depart2: depart2List) {
%>
	<option value="<%=depart2.getId()%>" <%=(theDepart2ID.equals(depart2.getId()))? "selected":""%> ><%=depart2.getDepartment2Name()%></option>
<%
}
%>
</select>
<%
}
%>
